package com.minimalist.common.entity.lindi.vo.subsidyapplication;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author 11987
 */

@Schema(name = "林地指标交易平台_补贴申请审批实体")
public class LindiSubsidyApplicationApprovalVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "补贴申请ID不能为空", groups = {Add.class, Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "subsidyApplicationId", description = "补贴申请ID", type = "string")
    private Long subsidyApplicationId;

    @NotNull(message = "审批结果不能为空", groups = {Add.class, Update.class})
    @Schema(name = "approvalResult", description = "审批结果：1-通过，2-驳回", type = "integer")
    private Integer approvalResult;

    @NotBlank(message = "审批意见不能为空", groups = {Add.class, Update.class})
    @Schema(name = "approvalComment", description = "审批意见", type = "string")
    private String approvalComment;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "approverId", description = "审批人ID", type = "string")
    private Long approverId;

    @Schema(name = "approverName", description = "审批人姓名", type = "string")
    private String approverName;

    @Schema(name = "approvalTime", description = "审批时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime approvalTime;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    private Long tenantId;

    public LindiSubsidyApplicationApprovalVO(){
    }

    public Long getSubsidyApplicationId(){
        return subsidyApplicationId;
    }

    public void setSubsidyApplicationId(Long subsidyApplicationId){
        this.subsidyApplicationId = subsidyApplicationId;
    }

    public Integer getApprovalResult(){
        return approvalResult;
    }

    public void setApprovalResult(Integer approvalResult){
        this.approvalResult = approvalResult;
    }

    public String getApprovalComment(){
        return approvalComment;
    }

    public void setApprovalComment(String approvalComment){
        this.approvalComment = approvalComment;
    }

    public Long getApproverId(){
        return approverId;
    }

    public void setApproverId(Long approverId){
        this.approverId = approverId;
    }

    public String getApproverName(){
        return approverName;
    }

    public void setApproverName(String approverName){
        this.approverName = approverName;
    }

    public LocalDateTime getApprovalTime(){
        return approvalTime;
    }

    public void setApprovalTime(LocalDateTime approvalTime){
        this.approvalTime = approvalTime;
    }

    public Long getUpdateId(){
        return updateId;
    }

    public void setUpdateId(Long updateId){
        this.updateId = updateId;
    }

    public LocalDateTime getUpdateTime(){
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime){
        this.updateTime = updateTime;
    }

    public Long getTenantId(){
        return tenantId;
    }

    public void setTenantId(Long tenantId){
        this.tenantId = tenantId;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        LindiSubsidyApplicationApprovalVO that = (LindiSubsidyApplicationApprovalVO) o;
        return Objects.equals(subsidyApplicationId, that.subsidyApplicationId) && Objects.equals(approvalResult, that.approvalResult) && Objects.equals(approvalComment, that.approvalComment) && Objects.equals(approverId, that.approverId) && Objects.equals(approverName, that.approverName) && Objects.equals(approvalTime, that.approvalTime) && Objects.equals(updateId, that.updateId) && Objects.equals(updateTime, that.updateTime) && Objects.equals(tenantId, that.tenantId);
    }

    @Override
    public int hashCode(){
        return Objects.hash(subsidyApplicationId, approvalResult, approvalComment, approverId, approverName, approvalTime, updateId, updateTime, tenantId);
    }
}